package com.lanou.utp.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;


@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ResponseData {

    private Integer code;
    private String message;
    private Object data;
    private Paging paging;

    public ResponseData(String message, Object data) {
        this.code = 200;
        this.message = message;
        this.data = data;
    }

    public ResponseData(String message) {
        this.code = 200;
        this.message = message;
    }

    public ResponseData(Integer code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public ResponseData(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public ResponseData(Object data) {
        this.code = 200;
        this.message = "ok";
        this.data = data;
    }

    public ResponseData(Object data, Paging paging) {
        this.code = 200;
        this.message = "ok";
        this.data = data;
        this.paging = paging;
    }

    public ResponseData() {
        this.code = 200;
        this.message = "ok";
        this.data = null;
        this.paging = null;
    }
}
